package com.kermitye.studentsys;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;

import androidx.annotation.Nullable;

import java.util.List;

public class MyService extends Service {

    public static MyService instance;

    public DBManager dbManager;

    @Nullable
    @Override
    public IBinder onBind(Intent intent) {
        return null;
    }


    @Override
    public void onCreate() {
        super.onCreate();
        instance = this;
        dbManager = new DBManager(this);
    }


    public void getData(final GetDataListener listener) {
        new Thread(new Runnable() {
            @Override
            public void run() {
                List<Student> result = dbManager.query();
                listener.onFinish(result);
            }
        }).start();
    }


}
